﻿using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;
using System.Data;
using System.Text;

namespace IHISCETeim.Web.MachineSys.YYModel
{
    public partial class YYShipmentEdit : PageBase
    {
        protected override string DWZRef
        {
            get
            {
                return "YYShipmentListEasyUI";
            }
        }

        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.修改 };
            }
        }

        protected int ShipmentID
        {
            get
            {

                return GetRequestValue<int>("ShipmentID", 0);
            }
        }

        private YYShipmentInfo _objFx = null;

        protected YYShipmentInfo obj
        {
            get
            {
                if (_objFx == null)
                    _objFx = YYShipmentController.GetByID(ShipmentID);
                return _objFx;
            }
        }




        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "edit")
            {
                addmenu();
            }
        }
        private void addmenu()
        {
            YYShipmentInfo objTrade = Request.SerializableObject<YYShipmentInfo>();


            bool msg = YYShipmentController.Update(objTrade);

            AddLog(Permission.修改, obj, objTrade);

            if (msg)
                SuccessJson("修改成功");
            else
            {

                ErrorJson("修改失败");
            }
        }
    }
}